package com.example.novelstory.service.dxy;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.novelstory.dao.dxy.CategoryDao;
import com.example.novelstory.entity.Category;
import java.util.List;
import org.springframework.stereotype.Service;

@Service
public class CategoryServicelmpl extends ServiceImpl<CategoryDao,Category> {
//    @Autowired
//    CategoryDao categoryDao;
//
//    @Override
    public List<Category> findcategoryAll() {
//        List<Category> all = categoryDao.findcategoryAll();
        return list();
    }

//    @Override
    public Boolean addcategoryInfo(Category category) {
//        int addcategoryInfo = categoryDao.addcategoryInfo(title,pid,sort,meta_title,meta_keywords,meta_description,icon,template_index,template_detail,template_filter,link,create_time,update_time,status,type);
//        if (addcategoryInfo == 1) {
//            List<Category> all = categoryDao.findcategoryAll();
//            return all;
//        } else {
            return save(category);

        }
//
//    }

//    @Override
    public Boolean deletecategoryInfo(int id) {
//        int usercategoryInfo = categoryDao.deletecategoryInfo(id);
//        if (usercategoryInfo == 1) {
//            List<Category> all = categoryDao.findcategoryAll();
//            return all;
//        } else {
            return removeById(id);

        }
//
//    }

//    @Override
    public Boolean updetecategoryInfo(Category category)   {
//        int updetecategoryInfo = categoryDao.updetecategoryInfo(title,pid,sort,meta_title,meta_keywords,meta_description,icon,template_index,template_detail,template_filter,link,create_time,update_time,status,type);
//        if (updetecategoryInfo == 1) {
//            List<Category> all = categoryDao.findcategoryAll();
//            return all;
//        } else {
//        QueryWrapper
            return updateById(category);

        }

    }
//}
